package jmine.tec.sync.channel;

import java.io.IOException;

import jmine.tec.rpc.sync.DatabaseSynchronizationCommand;
import jmine.tec.sync.DataPushChannel;
import jmine.tec.utils.io.IOUtils;

/**
 * Classe abstrata que jah serializa os comandos
 * 
 * @author takeshi
 */
public abstract class AbstractDataPushChannel implements DataPushChannel {

    /**
     * {@inheritDoc}
     */
    public void pushCommands(DatabaseSynchronizationCommand[] cmds) throws IOException {
        byte[] serialized = IOUtils.serializeObject(cmds);
        this.pushCommandsAsBytes(serialized);
    }

}
